<template>
	<ul class="mui-table-view">
		<li v-for="news in newslist"  class="mui-table-view-cell mui-media" :key="news.id">
			<router-link :to="'/home/newsinfo/'+news.id">
				<img class="mui-media-object mui-pull-left" :src="news.imgUrl">
				<div class="mui-media-body">
					{{news.title}}
					<p class='mui-ellipsis'>
						<span>发表时间 {{news.addTime | dateFormat}}</span>
						<span>点击: {{news.click}}次</span>
					</p>
				</div>
			</router-link>
		</li>
	
	</ul>
</template>
<style lang="less" scoped>
	.mui-ellipsis{
		display: flex;
		justify-content: space-between;
		span{
			font-size: 12px;
			color: #22a2ff;
		}
	}
</style>
<script>
import Interface from '../interface.js'
export default {
	data(){
		return {
			newslist:[]
		}
	},
	created(){
		this.axios.get(Interface.getnewslist)
		.then((data)=>{
			console.log(data.data.message)
			this.newslist = data.data.message
		},(err)=>{
			alert(err.message)
		})
	}
}
</script>
